package github.pop.ares.item;

import github.pop.ares.Utils;
import github.pop.ares.block.BlockRegistry;
import github.pop.ares.group.ModGroup;
import github.pop.ares.item.ObsidianIngot;
import github.pop.ares.network.ObsidianMessage;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

/**
 * 第二部，将我们创建的
 * {@link ObsidianIngot} 注册到游戏里
 */
public class ItemRegister {

    private static final DeferredRegister<Item> ITEMS;
    public static RegistryObject<Item> obsidianIngot;
    public static RegistryObject<Item> obsidianApple;
    public static final RegistryObject<Item> magicIngot;

    public static  RegistryObject<Item> obsidianWrench;
    static {
        ITEMS=DeferredRegister.create(ForgeRegistries.ITEMS, Utils.MOD_ID);

        obsidianIngot = ITEMS.register("obsidian_ingot", ObsidianIngot::new);
        obsidianApple = ITEMS.register("obsidian_apple", ObsidianApple::new);
         ITEMS.register("obsidian_sword", ObsidianSword::new);
        ITEMS.register("obsidian_pickaxe", ObsidianPickaxe::new);
        obsidianWrench = ITEMS.register("obsidian_wrench", ObsidianWrench::new);
        ITEMS.register("obsidian_message", ObsidianMessage::new);

        RegistryObject<Item> obsidianHelmet = ITEMS.register("obsidian_helmet", () -> new ArmorItem(ModArmorMaterial.OBSIDIAN, EquipmentSlotType.HEAD, (new Item.Properties()).tab(ModGroup.itemGroup)));
        RegistryObject<Item> obsidianChestplate = ITEMS.register("obsidian_chestplate", () -> new ArmorItem(ModArmorMaterial.OBSIDIAN, EquipmentSlotType.CHEST, (new Item.Properties()).tab(ModGroup.itemGroup)));
        RegistryObject<Item> obsidianLeggings = ITEMS.register("obsidian_leggings", () -> new ArmorItem(ModArmorMaterial.OBSIDIAN, EquipmentSlotType.LEGS, (new Item.Properties()).tab(ModGroup.itemGroup)));
        RegistryObject<Item> obsidianBoots = ITEMS.register("obsidian_boots", () -> new ArmorItem(ModArmorMaterial.OBSIDIAN, EquipmentSlotType.FEET, (new Item.Properties()).tab(ModGroup.itemGroup)));

        magicIngot=ITEMS.register("magic_ingot", MagicIngot::new);

        ///setblock x y z neutriono:obsidian_block

        RegistryObject<Item> obsidianBlock = ITEMS.register("obsidian_block", () -> new BlockItem(BlockRegistry.obsidianBlock.get(), new Item.Properties().tab(ModGroup.itemGroup)));

        RegistryObject<Item> obsidianRubikCube = ITEMS.register("obsidian_rubik_cube", () -> new BlockItem(BlockRegistry.obsidianRubikCube.get(), new Item.Properties().tab(ModGroup.itemGroup)));

        RegistryObject<Item> obsidianFrame = ITEMS.register("obsidian_frame", () -> new BlockItem(BlockRegistry.obsidianFrame.get(), new Item.Properties().tab(ModGroup.itemGroup)));


        RegistryObject<Item> glassJar = ITEMS.register("glass_jar", () -> new BlockItem(BlockRegistry.glassJar.get(), new Item.Properties().tab(ModGroup.itemGroup)));

        RegistryObject<Item> obsidianObj = ITEMS.register("obsidian_obj", () -> new BlockItem(BlockRegistry.obsidanObj.get(), new Item.Properties().tab(ModGroup.itemGroup)));


        RegistryObject<Item> obsidianObjCounter = ITEMS.register("obsidian_counter_block", () -> new BlockItem(BlockRegistry.obsidianCounterBlock.get(), new Item.Properties().tab(ModGroup.itemGroup)));

        RegistryObject<Item> obsidianHelloBlock = ITEMS.register("obsidian_hello_block", () -> new BlockItem(BlockRegistry.obsidianHelloBlock.get(), new Item.Properties().tab(ModGroup.itemGroup)));

        RegistryObject<Item> obsidianHiddenBlock = ITEMS.register("obsidian_hidden_block", () -> new BlockItem(BlockRegistry.obsidianHiddenBlock.get(), new Item.Properties().tab(ModGroup.itemGroup)));

        RegistryObject<Item> obsidianTerBlock = ITEMS.register("obsidian_ter_block", () -> new BlockItem(BlockRegistry.obsidianTERBlock.get(), new Item.Properties().tab(ModGroup.itemGroup)));

    }
    public static void register(IEventBus bus){
        ITEMS.register(bus);
    }

}
